set @kaynak='28';
set @hedef='09';
set @bastarih='2015-07-27';
set @sontarih='2015-08-01';
#sql
SELECT A.STOK_KODU, A.STOK_ADI, ROUND(SUM( B.MIKTAR ),2) AS GIREN_MIK ,ROUND(A.SATIS_FIAT2,2) AS TFIYAT, ROUND( SUM( B.MIKTAR ) * A.SATIS_FIAT2, 2 ) AS MIKTAR
FROM STHAR AS B
INNER JOIN TBLSTSABIT AS A ON A.STOK_KODU = B.STOK_KODU
WHERE KAYNAK = @kaynak
AND HEDEF = @hedef
AND TARIH >= @bastarih
AND TARIH <= @sontarih
GROUP BY A.STOK_KODU